namespace :update do
 task :owner  => :environment do
   coms = Company.find(:all)
   coms.each do |com|
    sleep 0.1
    if com.account_owner
     com.owner_id = com.account_owner.id
     puts com.owner_id.to_s + ":" + com.id.to_s
     com.save
    else
    puts  'error'
    end
   end
 end
end
